package com.itheima.behaviour.controller;
import com.itheima.behaviour.dto.ReadBehaviorDto;
import com.itheima.behaviour.pojo.ApReadBehavior;
import com.itheima.behaviour.service.ApReadBehaviorService;
import com.itheima.common.pojo.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import com.itheima.core.controller.AbstractCoreController;

/**
* <p>
* APP阅读行为表 控制器</p>
* @author 作者
* @since 2021-08-30
*/
@RestController
@RequestMapping("/apReadBehavior")
public class ApReadBehaviorController extends AbstractCoreController<ApReadBehavior> {

    private ApReadBehaviorService apReadBehaviorService;

    //注入
    @Autowired
    public ApReadBehaviorController(ApReadBehaviorService apReadBehaviorService) {
        super(apReadBehaviorService);
        this.apReadBehaviorService=apReadBehaviorService;
    }

    /***
     * 添加用户阅读行为
     */
    @PostMapping(value = "/read")
    public Result read(@RequestBody ReadBehaviorDto dto){
        apReadBehaviorService.readBehavior(dto);
        return Result.ok();
    }
}

